<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="zh-CN"><head>
     <base href="<%=basePath%>"> 
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico" tppabs="http://v3.bootcss.com/favicon.ico">

    <title>桌边零食-随时随地，想购就购~(～￣▽￣)～</title>

    <!-- Bootstrap core CSS -->
   <link href="shop/public/assets/bootstrap/css/bootstrap.min.css" tppabs="http://cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
 <link rel="stylesheet" href="shop/public/css/custom.css">
    <!-- Custom styles for this template -->
    <link href="shop/public/css/dashboard.css" tppabs="http://v3.bootcss.com/examples/dashboard/dashboard.css" rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js" tppabs="http://v3.bootcss.com/assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="shop/public/assets/js/ie-emulation-modes-warning.js" tppabs="http://v3.bootcss.com/assets/js/ie-emulation-modes-warning.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="../../../cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js" tppabs="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="../../../cdn.bootcss.com/respond.js/1.4.2/respond.min.js" tppabs="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    
    
    <!-- -----------------------js---------------------------- -->
    <script>
    
    //按钮状态一
    function status1(){
    var test=document.getElementsByTagName("input");  
     var button=document.getElementById("button");
    
    
     
     test[1].readOnly=false;
     test[1].style.cssText=' ';
     
     test[2].readOnly=false;
     test[2].style.cssText=' ';
     
     test[3].readOnly=false;
     test[3].style.cssText=' ';
     
     test[4].readOnly=false;
     test[4].style.cssText=' ';
     
     test[5].readOnly=false;
     test[5].style.cssText=' ';
     
    
         
    }
    
    //按钮状态二
    function status2(){
    var test=document.getElementsByTagName("input");  
     var button=document.getElementById("button");
     test[1].readOnly=true;
     test[1].style.cssText='background-color:#eeeeee;opacity:0.8; ';
     
     test[2].readOnly=true;
     test[2].style.cssText='background-color:#eeeeee;opacity:0.8; ';
     
     test[3].readOnly=true;
     test[3].style.cssText='background-color:#eeeeee;opacity:0.8; ';
     
     test[4].readOnly=true;
     test[4].style.cssText='background-color:#eeeeee;opacity:0.8; ';
     
     test[5].readOnly=true;
     test[5].style.cssText=' background-color:#eeeeee;opacity:0.8;';
     
     
    }
    
    
    //按钮双切换控制
    function Edit(){
          var btnE = document.getElementById("button"),text;
                text = btnE.innerText;
                btnE.innerText = text === "编辑" ? "取消":"编辑";
                text === "编辑" ? status1():status2();
      }
    
    
    </script>
    
  </head>

  <body  onload="isDisplayUser('<%=request.getSession().getAttribute("username") %>')"  background="public\assets\img\backgrounds\back.jpg" >

   <!--导航栏开始-->
			<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
				<div class="container-fluid">
					<!--导航头部(logo)-->
					<div class="navbar-header">
						<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse" aria-expanded="false"> 
		                	<span class="icon-bar"></span>
		                    <span class="icon-bar"></span>
		                    <span class="icon-bar"></span> 
	                    </button> 
	                    <a style="color:#f22e00" class="navbar-brand" href="<%=basePath%>index.jsp" ><i>桌边零食</i></a>
					</div>
					<!--导航列表-->
					<div id="navbar-collapse"  >
						<ul class="nav navbar-nav">
							<li class="active">
								<a class="head-a" href="<%=basePath%>index.jsp">首页 <span class="sr-only">(current)</span></a>
							</li>
							<!--用户订单记录(重要) 支付和未支付的-->
							<li class="dropdown">
								<a href="#" class="dropdown-toggle head-a" data-toggle="dropdown" role="button"><span style="color:#f22e00" class="glyphicon glyphicon-inbox"></span> 我的桌边 <span class="caret"></span></a>
								<ul class="dropdown-menu" role="menu">
									<li><a href="#">已买到的零食</a></li><!--已支付已接收的订单-->
									<li class="divider"></li>
									<li><a href="#">最近购物</a></li> 
								</ul>
							</li>
							<!--购物车-->
							<li><a class="head-a" href="cartList?userid=<%=request.getSession().getAttribute("userid") %>&&page=1" ><span style="color:#f22e00" class="glyphicon glyphicon-shopping-cart"></span> 
							购物车 <span id="cartNum" ><%=request.getSession().getAttribute("cartNum") %></span></a>
							</li>
							<!--收藏夹-->
							<li><a class="head-a" href="showTheFav?userid=<%=request.getSession().getAttribute("userid") %>"  role="button" aria-expanded="true"><span style="color:#f22e00" class="glyphicon glyphicon-star"></span> 收藏夹 </a>
							</li>
							<li class="dropdown"><a class="head-a" href="#" href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="true"><span style="color:#f22e00" class="glyphicon glyphicon-th-list"></span> 网站导航 <span class="caret"></span></a>
								<ul class="dropdown-menu" role="menu">
									<li role="presentation" class="dropdown-header">休闲零食</li>
						            <li><a href="pageAction!showProductsPage.action?categoryName=坚果炒货&pageIndex=1">坚果炒货</a></li>
						            <li><a href="pageAction!showProductsPage.action?categoryName=梅/果干&pageIndex=1">梅/果干</a></li>
						            <li><a href="pageAction!showProductsPage.action?categoryName=糖果巧克力&pageIndex=1">糖果巧克力</a></li>
						            <li class="divider"></li>
						            <li role="presentation" class="dropdown-header">饼干糕点</li>
						            <!--自定义的菜单样式submenu-->
						            <li class="dropdown-submenu">
						            	<a href="#"  class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="true">传统糕点  </a>
						            	<ul class="dropdown-menu" role="menu">
						            		<li><a href="pageAction!showProductsPage.action?categoryName=麻薯&pageIndex=1">麻薯</a></li>
								            <li><a href="pageAction!showProductsPage.action?categoryName=凤梨酥&pageIndex=1">凤梨酥</a></li>
								            <li><a href="pageAction!showProductsPage.action?categoryName=黄山烧饼&pageIndex=1">黄山烧饼</a></li>
						            	</ul>

						            </li>
						            <li class="dropdown-submenu">
						            	<a href="#"  class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="true">西式糕点</a>
						            	<ul class="dropdown-menu" role="menu">
						            		<li><a href="pageAction!showProductsPage.action?categoryName=华夫饼&pageIndex=1">华夫饼</a></li>
								            <li><a href="pageAction!showProductsPage.action?categoryName=铜锣烧&pageIndex=1">铜锣烧</a></li>
								            <li><a href="pageAction!showProductsPage.action?categoryName=牛乳蛋糕&pageIndex=1">牛乳蛋糕</a></li>
						            	</ul> 
						            </li>
						            <li class="divider"></li>
						            <li role="presentation" class="dropdown-header">茶水饮料</li>
						            <li class="dropdown-submenu">
						            	<a href="#"  class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="true">红茶</a>
						            	<ul class="dropdown-menu" role="menu">
						            		<li><a href="pageAction!showProductsPage.action?categoryName=正山小种&pageIndex=1">正山小种</a></li>
								            <li><a href="pageAction!showProductsPage.action?categoryName=祁门红茶&pageIndex=1">祁门红茶</a></li>
								            <li><a href="pageAction!showProductsPage.action?categoryName=川红&pageIndex=1">川红</a></li>
						            	</ul> 
						            </li>
						            <li class="dropdown-submenu">
						            	<a href="#"  class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="true">饮料</a>
						            	<ul class="dropdown-menu" role="menu">
						            		<li><a href="pageAction!showProductsPage.action?categoryName=碳酸饮料&pageIndex=1">碳酸饮料</a></li>
								            <li><a href="pageAction!showProductsPage.action?categoryName=即饮咖啡&pageIndex=1">即饮咖啡</a></li>
								            <li><a href="pageAction!showProductsPage.action?categoryName=果味饮料&pageIndex=1">果味饮料</a></li>
						            	</ul> 
						            </li>
						        </ul>
							</li>
						</ul> 
						<!--右边导航栏-->
						<ul class="nav navbar-nav navbar-right">
						
							<!--搜索零食-->
							<form class="navbar-form navbar-left" role="search" action="search">
								<div class="input-group">
									<input type="text" name="search" class="form-control" placeholder="零食传送门....">
									<span class="input-group-btn">
										<button class="btn btn-default" type="sumbit">
											<span style="color:#f22e00" class="glyphicon glyphicon-search"></span> 
											走起！
										</button>
									</span>
								</div>
							</form>
							
							<!--登录后修改为用户名-->
							<li><a class="head-a" id="userLogin" href="shop/Login.jsp"  style="color:#f22e00;display:display;">亲,请先登录!</a></li>
							<li class="dropdown">
								<a id="user" name="user.username" href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" style="color:#f22e00;display:none;">
									<span><img/></span> 
									<%=request.getSession().getAttribute("username") %> 
									<span class="caret"></span>
								</a>
								<ul class="dropdown-menu" role="menu"> 
									<li><a href="shop/Setting.jsp">个人中心</a></li><!-- 用户设置 -->
									<li class="divider"></li>
									<li><a href="quit">退出</a></li><!--用户退出，清除cookie-->
								</ul>
							</li>
						</ul>
					</div>
				</div>
			</nav>
			<!--导航栏结束-->

    <div class="container-fluid">
      <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">
          <ul class="nav nav-sidebar">
            <li ><a href="ShowSetting!showProfile.action">我的足迹<span class="sr-only">(current)</span></a></li>
            <li class="active"><a href="ShowProfile!showProfile.action">个人资料</a></li>
            <li><a href="ShowPasswordEdit!showProfile.action">密码修改</a></li>
           
          </ul>
        </div>
        
        
        <!------------------------------------------------------中间部分------------------------------->
		<s:if test="listFav>0">
			<table class="table table-bordered" >
				<thead>
					<tr>  
						<th>商品略缩图</th>
						<th>商品名称</th>
						<th>单价</th> 
						<th>操作</th>
					</tr>
				</thead>
				<!-- 遍历 -->
				<tbody>
					<s:iterator  value="listFav">
						<tr>
							<td style="vertical-align: middle;"><a href="pageAction!showProductInfoAction.action?productId=<s:property value="shopProduct.productid"/>"><img src="<s:property value="cover"/>" class="img-rounded"/></a></td>
							<td style="vertical-align: middle;" ><a href="pageAction!showProductInfoAction.action?productId=<s:property value="shopProduct.productid"/>"><s:property value="title"/></a></td>
							<td style="vertical-align: middle;" ><s:property value="price"/></td>
							<!-- 删除该行的商品 -->
							<td style="vertical-align: middle;">
								<span style="color:#d9534f" class="btn glyphicon glyphicon-trash"  onclick="delToFav(<%=request.getSession().getAttribute("userid")%>,<s:property value="favoriteid"/>);"></span>
							</td>
						</tr>  
					</s:iterator>
				</tbody><!-- 结束 --> 
			</table>
			<s:iterator value="pageProductBean">
				<div>
					<nav>
					  <ul class="pager">
					 	<li>共<s:property value="allRow" />条记录 </li>
						<li>共<s:property value="totalPage" />页 </li>
						<li>当前第<s:property value="currentPage" />页</li>
						<s:if test="%{currentPage == 1}">
							<li class="disabled"><a href="#">第一页</a></li>
							<li class="disabled"><a href="#">上一页</a></li>
						</s:if>
						<s:else>
							<li><a href="search?page=1">第一页</a></li>
							<li><a href="search?page=<s:property value="%{currentPage-1}"/>">上一页</a></li>
						</s:else> 
						<s:if test="%{currentPage != totalPage}" >
							<li><a
								href="search?page=<s:property value="%{currentPage+1}"/>">下一页</a>
							</li>
							<li>
							<a
								href="search?page=<s:property value="totalPage"/>">最后一页</a>
							</li>
						</s:if> 
						<s:else>
						 	<li class="disabled"><a href="#">下一页 </a></li>
						 	<li class="disabled"><a href="#">最后一页 </a></li>    
						</s:else>
					  </ul>
					</nav>
			    </div>
		    </s:iterator> 
		</s:if>
		<s:else>
			<div class="container shopCart">
				<div class="row clearfix">
					<div class="col-md-12 column">
						<br/>
						<h4>你的收藏夹中没有物品</h4>
						<hr/>
						<div class="jumbotron">
							<h1>什么都没有</h1>
						    <p style="text-indent:2em;">装一袋阳光两把海风，自制了几斤祝福，托人到美国买了些快乐，法国买了两瓶浪漫，从心灵的深处切下几许关怀，作为礼物送给你，祝平安快乐~</p>
						</div> 
					</div>
				</div>
			</div>
		</s:else>
        <!------------------------------------------------------中间部分结束------------------------------->
        
        
      </div>
    </div>

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
   <script src="shop/public/assets/js/jquery-1.11.1.min.js"></script>
        <script src="shop/public/assets/bootstrap/js/bootstrap.min.js"></script> 
        <script src="shop/public/assets/js/retina-1.1.0.min.js"></script>
        <!--修改背景-->
        <script src="shop/public/assets/js/scripts.js"></script>
        <script src="shop/public/assets/js/jquery.backstretch.min.js"></script>  
     <script src="shop/public/assets/js/user.js"></script>
        <!-- 购物车 -->
        <script src="shop/public/assets/js/cart.js"></script>

<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200" preserveAspectRatio="none" style="visibility: hidden; position: absolute; top: -100%; left: -100%;"><defs></defs><text x="0" y="10" style="font-weight:bold;font-size:10pt;font-family:Arial, Helvetica, Open Sans, sans-serif;dominant-baseline:middle">200x200</text></svg></body></html>